package com.py.purchase.service.impl;


import com.py.purchase.domain.PyAttachment;
import com.py.purchase.mapper.PyAttachmentMapper;
import com.py.purchase.service.IPyAttachmentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * 附件Service业务层处理
 * 
 * @author 童佳
 * @date 2024-11-27
 */
@Service
public class PyAttachmentServiceImpl implements IPyAttachmentService
{
    @Resource
    private PyAttachmentMapper pyAttachmentMapper;

    /**
     * 查询附件
     * 
     * @param attachmentId 附件主键
     * @return 附件
     */
    @Override
    public PyAttachment selectPyAttachmentByAttachmentId(Integer attachmentId)
    {
        return pyAttachmentMapper.selectPyAttachmentByAttachmentId(attachmentId);
    }

    /**
     * 查询附件列表
     * 
     * @param pyAttachment 附件
     * @return 附件
     */
    @Override
    public List<PyAttachment> selectPyAttachmentList(PyAttachment pyAttachment)
    {
        return pyAttachmentMapper.selectPyAttachmentList(pyAttachment);
    }

    /**
     * 新增附件
     * 
     * @param pyAttachment 附件
     * @return 结果
     */
    @Override
    public int insertPyAttachment(PyAttachment pyAttachment)
    {
        return pyAttachmentMapper.insertPyAttachment(pyAttachment);
    }

    /**
     * 修改附件
     * 
     * @param pyAttachment 附件
     * @return 结果
     */
    @Override
    public int updatePyAttachment(PyAttachment pyAttachment)
    {
        return pyAttachmentMapper.updatePyAttachment(pyAttachment);
    }

    /**
     * 批量删除附件
     * 
     * @param attachmentIds 需要删除的附件主键
     * @return 结果
     */
    @Override
    public int deletePyAttachmentByAttachmentIds(Integer[] attachmentIds)
    {
        return pyAttachmentMapper.deletePyAttachmentByAttachmentIds(attachmentIds);
    }

    /**
     * 删除附件信息
     * 
     * @param attachmentId 附件主键
     * @return 结果
     */
    @Override
    public int deletePyAttachmentByAttachmentId(Integer attachmentId)
    {
        return pyAttachmentMapper.deletePyAttachmentByAttachmentId(attachmentId);
    }

    @Override
    public int deletePyAttachmentByOwnershipNumber(String ownershipNumber) {
        return pyAttachmentMapper.deletePyAttachmentByOwnershipNumber(ownershipNumber);
    }
}
